<?php
namespace App\Api;
use PhalApi\Api;
use App\Domain\Type as DomainType;
/**
 * 文章类型
 * @author 张启峰
 */
class Type extends Api {

    public function getRules() {
        return [
            'getBatch' => [
                'cate' => ['name' => 'cate', 'require' => true, 'desc' => '文档分类'],
                'tid' => ['name' => 'tid', 'require' => false, 'default' => '', 'desc' => '文档栏目id']
            ]
        ];
    }

    /**
     * 文章类型接口
     * @desc 获取文章类型
     * @return int id 类型id
     * @return int sortrank 类型排序
     * @return string typename 类型名称
     */
    public function getAll() {
        $redata = [];
        $domain = new DomainType();
        $rs = $domain->getAll();
        $redata['Type'] = $rs['items'];
        return $redata;
    }

}
